package com.quectel.sdk.baidu.img;

import com.quectel.sdk.baidu.BaiduBCEClientBuilder;
import com.quectel.sdk.baidu.model.img.BaiduBCEImgResp;
import com.quectel.util.common.JacksonUtils;
import com.quectel.util.common.Response;

/**
 * @author zhangheng
 * @email nolan.zhang@quectel.com
 * @date 2023/5/12 9:22
 * @description new java file header...
 */
public class BaiduBCEImgTest {

    public static void main(String[] args) {

        BaiduBCEImgClient client = BaiduBCEClientBuilder.builder().host("https://aip.baidubce.com").apikey("czLmrsenYevNEfYTQavfTQop").secretKey("pG9xFY2dMpRYH61GwpLrZAuwZvKBqkrG").build(BaiduBCEImgClient.class);
//        BaiduBCEImgResp baiduBCEImgResp = client.checkByImgUrl("https://dev-smartcity.quectel.com:10443/public-bucket/2023/05/12/audit_demo_default-demo.jpg");
//        System.out.println(JacksonUtils.toJsonString(baiduBCEImgResp));

//        BaiduBCEImgResp baiduBCEImgResp1 = client.checkByFile("C:\\Users\\nolan.zhang\\Desktop\\audit_demo_default-demo.jpg");
//        System.out.println(JacksonUtils.toJsonString(baiduBCEImgResp1));
        BaiduBCEImgClient.ImgInfo imgInfoByURL = client.getImgInfoByURL("https://dev-smartcity.quectel.com:10443/public-bucket/2023/05/12/audit_demo_default-demo.jpg");
//        BaiduBCEImgClient.ImgInfo imgInfoByURL = client.getImgInfoByURL("https://dev-smartcity.quectel.com:10443/public-bucket/2023/05/15/转账截图.jpeg");
        Response response = client.requestPreCheck(imgInfoByURL);
        BaiduBCEImgResp baiduBCEImgResp = client.checkByImgUrl(imgInfoByURL.getUrl());


        System.out.println(JacksonUtils.toJsonString(baiduBCEImgResp));


    }

}
